home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_autotorch2.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  114 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_AutoTorch2.cog
  4. #
  5. # Light two torches at the same time without any sound phasing
  6. #
  7. # [TRM]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.     message     startup
  15.     message     entered
  16.     
  17.     thing       torch1
  18.     thing       torch2
  19.     thing       flame1
  20.     thing       flame2
  21.     
  22.     sector      liteSect
  23.     sector      sec_NoBurn
  24.     sector      sec_Burn
  25.     
  26.     sound       burning=gen_torch_burnin_c.wav      local
  27.     sound       lite=gen_torchlitet_c.wav           local
  28.     
  29.     flex        lituptime=0.5
  30.     flex        maxradius=0.35
  31.     
  32.     vector      normLight       local
  33.     vector      redLight        local
  34.     
  35.     int         lit=0           local
  36.     int         burn_Chnl1      local
  37.     int         burn_Chnl2      local
  38.     int         burn_On         local
  39.     int         red
  40.     
  41. end
  42.  
  43. # ========================================================================================
  44.  
  45. code
  46.  
  47. startup:
  48.  
  49.     normLight = VectorSet(0.87, 0.55, 0.06);
  50.     redLight = VectorSet(0.87, 0.05, 0.05);
  51.     SetThingFlags(flame1, 0x10);
  52.     SetThingFlags(flame2, 0x10);
  53.     return;
  54.  
  55. # ========================================================================================
  56.  
  57. entered:
  58.  
  59.     if((GetSenderRef() == liteSect) && (lit == 0))
  60.     {
  61.         lit = 1;
  62.         
  63.         # show torches
  64.         ClearThingFlags(flame1, 0x10);
  65.         ClearThingFlags(flame2, 0x10);
  66.         
  67.         # play torch light sound locally
  68.         PlaySoundLocal(lite, 1.0, 0.0, 0x0, 1);
  69.         
  70.         if(red == 0)
  71.         {
  72.             SetThingLight(torch1, normLight, 0.001, lituptime);
  73.             SetThingLight(torch2, normLight, 0.001, lituptime);
  74.             SetThingLight(flame1, normLight, maxradius, lituptime);
  75.             SetThingLight(flame2, normLight, maxradius, lituptime);
  76.         }
  77.         
  78.         else
  79.         {
  80.             SetThingLight(torch1, redLight, 0.001, lituptime);
  81.             SetThingLight(torch2, redLight, 0.001, lituptime);
  82.             SetThingLight(flame1, redLight, maxradius, lituptime);
  83.             SetThingLight(flame2, redLight, maxradius, lituptime);
  84.         }
  85.         
  86.         # play torch burning sounds
  87.         burn_Chnl1 = PlaySoundThing(burning, torch1, 1.0, 10, 25, 0x0001);
  88.         Sleep(Rand() + 0.1);
  89.         burn_Chnl2 = PlaySoundThing(burning, torch2, 1.0, 10, 25, 0x0001);
  90.     }
  91.     
  92.     # turn OFF burn sfx
  93.     if((GetSenderRef() == sec_NoBurn) && (lit == 1) && (burn_On == 1))
  94.     {
  95.         burn_On = 0;
  96.         StopSound(burn_Chnl1, 0.5);
  97.         StopSound(burn_Chnl2, 0.5);
  98.     }
  99.     
  100.     # turn ON burn sfx
  101.     if((GetSenderRef() == sec_Burn) && (lit == 1) && (burn_On == 0))
  102.     {
  103.         burn_On = 1;
  104.         burn_Chnl1 = PlaySoundThing(burning, torch1, 1.0, 10, 25, 0x0001);
  105.         Sleep(Rand() + 0.1);
  106.         burn_Chnl2 = PlaySoundThing(burning, torch2, 1.0, 10, 25, 0x0001);
  107.     } 
  108.     
  109.     return;
  110.         
  111. # ========================================================================================
  112.         
  113. end
  114.